package com.yuexun.beilunpatient.ui.docAdvice.ui;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.base.BaseKJActivity;
import com.yuexun.beilunpatient.ui.docAdvice.ui.fragment.Frag_Dispensing;
import com.yuexun.beilunpatient.ui.docAdvice.ui.fragment.Frag_Injection;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by chenss on 2018/3/29 0029.
 */

public class Act_DocAdvice extends BaseKJActivity {

    @Bind(R.id.doc_dispensing_tv)
    TextView docDispensingTv;
    @Bind(R.id.doc_dispensing_img)
    ImageView docDispensingImg;
    @Bind(R.id.doc_dispensing_img_01)
    ImageView docDispensingImg01;
    @Bind(R.id.doc_injection_tv)
    TextView docInjectionTv;
    @Bind(R.id.doc_injection_img)
    ImageView docInjectionImg;
    @Bind(R.id.doc_injection_img_01)
    ImageView docInjectionImg01;

    private KJFragment fragDispensing;
    private KJFragment fragInjection;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_docadvice);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        fragDispensing = new Frag_Dispensing();
        fragInjection = new Frag_Injection();
        changeFragment(R.id.docadvice_frame, fragDispensing);
    }

    @OnClick({R.id.title_back, R.id.dispensing_ll, R.id.injection_ll})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_back:
                finish();
                break;
            case R.id.dispensing_ll:
                change_frag_01();
                break;
            case R.id.injection_ll:
                change_frag_02();
                break;
        }
    }

    public void change_frag_01() {
        docDispensingTv.setTextColor(getResources().getColor(R.color.main_text_02));
        docDispensingImg.setVisibility(View.VISIBLE);
        docDispensingImg01.setVisibility(View.GONE);
        docInjectionTv.setTextColor(getResources().getColor(R.color.txt_black1));
        docInjectionImg.setVisibility(View.GONE);
        docInjectionImg01.setVisibility(View.VISIBLE);
        changeFragment(R.id.docadvice_frame, fragDispensing);
    }

    public void change_frag_02() {
        docDispensingTv.setTextColor(getResources().getColor(R.color.txt_black1));
        docDispensingImg.setVisibility(View.GONE);
        docDispensingImg01.setVisibility(View.VISIBLE);
        docInjectionTv.setTextColor(getResources().getColor(R.color.main_text_02));
        docInjectionImg.setVisibility(View.VISIBLE);
        docInjectionImg01.setVisibility(View.GONE);
        changeFragment(R.id.docadvice_frame, fragInjection);
    }
}
